import datetime

class DateConfig:
    year = 2020
    month = 12

    def __init__(self, configObj):
        auto = configObj['date']['auto_date']
        if auto == 'True':
            cur = datetime.datetime.now()
            self.year = cur.year
            self.month = cur.month
        else:
            self.year = int(configObj['date']['year'])
            self.month = int(configObj['date']['month'])

class StyleConfig:
    content_font = []
    content_week_horizontal = ''
    content_week_vertical = ''
    content_day_horizontal = ''
    content_day_vertical = ''
    content_column_width = ''
    content_row_height = ''
    
    title_font = []
    title_horizontal = ''
    title_vertical = ''

    def __init__(self, configObj):
        self.content_font = [
            configObj['content_style_font']['font_name'], 
            int(configObj['content_style_font']['font_detail']['size']), 
            True if configObj['content_style_font']['font_detail']['bold'] == 'True' else False, 
            configObj['content_style_font']['font_detail']['color']
        ]

        self.content_week_horizontal = configObj['content_style_others']['week_horizontal']
        self.content_week_vertical = configObj['content_style_others']['week_vertical']
        self.content_day_horizontal = configObj['content_style_others']['day_horizontal']
        self.content_day_vertical = configObj['content_style_others']['day_vertical']

        self.content_column_width = configObj['content_style_others']['column_width']
        self.content_row_height = configObj['content_style_others']['row_height']

        self.title_font = [
            configObj['title_style_font']['font_name'], 
            int(configObj['title_style_font']['font_detail']['size']), 
            True if configObj['title_style_font']['font_detail']['bold'] == 'True' else False, 
            configObj['title_style_font']['font_detail']['color']
        ]

        self.title_horizontal = configObj['title_style_others']['horizontal']
        self.title_vertical = configObj['title_style_others']['vertical']
